//
//  myTableViewCell.m
//  textfiled格式化
//
//  Created by iOS on 16/6/20.
//  Copyright © 2016年 iOS. All rights reserved.
//

#import "myTableViewCell.h"
#import "ZJTextfieldView.h"
@interface myTableViewCell()<UITextFieldDelegate>
@property (nonatomic,strong)ZJTextfieldView * account;
@end

@implementation myTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self create];
    }
    return self;
}

-(void)create{
    ZJTextfieldView * Account = [[ZJTextfieldView alloc]initWithFrame:CGRectMake(0, 0, 300, 50)];
           Account.ZJtextfield.borderStyle = UITextBorderStyleRoundedRect;
        Account.ZJTextfieldStyle = ZJTextFieldStyleAccount;
        Account.ZJtextfield.placeholder = @"账号  ZJTextFieldStyleAccount";
        // Account.talbeListArray = [NSMutableArray arrayWithArray:@[@"wewe",@"sdsdsd",@"sdsdsd"]];
        Account.ZJtextfield.delegate = self;
        [self addSubview:Account];
        self.backgroundColor = [UIColor blueColor];
        self.account = Account;
        UILabel * label = [[UILabel alloc]initWithFrame:CGRectMake(300, 0, 30, 50)];
        label.text = @"2";
        [self addSubview: label];
 
}


- (void)textFieldDidBeginEditing:(UITextField *)textField{
    
    if (textField == self.account.ZJtextfield) {
        [self.account ZJtextFieldCreateTableviewDidBeginEditing:textField];
    }
    //return YES;
    
}

- (void)textFieldDidEndEditing:(UITextField *)textField{
    if (textField == self.account.ZJtextfield) {
        [self.account ZJtextFieldWriteTextDidEndEditing:self.account.ZJtextfield];
    }
    
    
}



- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{
    if (textField == self.account.ZJtextfield) {
        return [self.account ZJtextField:textField shouldChangeCharactersInRange:range replacementString:string];
    }
    
    return YES;
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    if (textField == self.account.ZJtextfield) {
        return [self.account ZJtextFieldShouldReturn:textField];
    }
    
    
    return YES;}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
